package com.syh.jn.scm.service.api.driver.logistics.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Created by soci.song on 2018/10/18.
 */
public interface DriverLogisticsBillEnums{

    @Getter
    @AllArgsConstructor
    public enum State {
        //物流状态
        DRIVER_UNDELIVERY(Short.valueOf("0"),"未发车","物流状态"),
        DRIVER_DELIVERED(Short.valueOf("1"),"已发车","物流状态"),
        DRIVER_SIGNIN(Short.valueOf("2"),"已收货","物流状态");

        private Short status;
        private String statusName;
        private String statusBelong;

        @Override
        public String toString() {
            return this.status.toString();
        }

        public static State build(Short status){
            switch (status){
                case 0:
                    return DRIVER_UNDELIVERY;
                case 1:
                    return DRIVER_DELIVERED;
                case 2:
                    return DRIVER_SIGNIN;
                default:
                    return null;
            }
        }
    }
    @Getter
    @AllArgsConstructor
    public enum StatementState {
        //物流结算状态
        NOT_STATEMENT(Short.valueOf("0"),"未生成对账单","物流结算状态"),
        STATEMENT(Short.valueOf("1"),"已生成对账单","物流结算状态"),
        CANCEL_STATEMENT(Short.valueOf("-1"),"取消对账单","物流结算状态");

        private Short status;
        private String statusName;
        private String statusBelong;

        @Override
        public String toString() {
            return this.status.toString();
        }

        public static StatementState build(Short status){
            switch (status){
                case 0:
                    return NOT_STATEMENT;
                case 1:
                    return STATEMENT;
                case 2:
                    return CANCEL_STATEMENT;
                default:
                    return null;
            }
        }
    }

    @Getter
    @AllArgsConstructor
    public enum OrderType {
        //所属订单类型
        ORDER_TYPE_SALE(Short.valueOf("0"),"销售单","订单类型"),
        ORDER_TYPE_RETURN_SALE(Short.valueOf("1"),"销售退货单","订单类型"),
        ORDER_TYPE_PURCHASE(Short.valueOf("2"),"采购单","订单类型"),
        ORDER_TYPE_RETURN_PURCHASE(Short.valueOf("3"),"采购退货单","订单类型");

        private Short status;
        private String statusName;
        private String statusBelong;

        @Override
        public String toString() {
            return this.status.toString();
        }

        public static OrderType build(Short status){
            switch (status){
                case 0:
                    return ORDER_TYPE_SALE;
                case 1:
                    return ORDER_TYPE_RETURN_SALE;
                case 2:
                    return ORDER_TYPE_PURCHASE;
                case 3:
                    return ORDER_TYPE_RETURN_PURCHASE;
                default:
                    return null;
            }
        }
    }

    @Getter
    @AllArgsConstructor
    public enum CustomerType {
        // 往来单位类型
        CUSTOMER_TYPE_UPSTREAM(Short.valueOf("0"), "上游", "往来单位类型"),
        CUSTOMER_TYPE_DOWNSTREAM(Short.valueOf("1"), "下游", "往来单位类型");

        private Short status;
        private String statusName;
        private String statusBelong;

        @Override
        public String toString() {
            return this.status.toString();
        }

        public static CustomerType build(Short status){
            switch (status){
                case 0:
                    return CUSTOMER_TYPE_UPSTREAM;
                case 1:
                    return CUSTOMER_TYPE_DOWNSTREAM;
                default:
                    return null;
            }
        }
    }
}

